###############################################################################
#                                                                      #
# FS2004 VTOL / Effect Control gauge for UKMIL  Harrier             #
#                                                                      #
#                     By Rob Barendregt                  7 Oct. 2005   #
#                                                                      #
########################################################################


What the VTOL gauge essentially does: when VTOL-control is activated, it overrides
the normal FS aircraft flightdynamic calculations, so complete control of the
aircraft is done by intelligent gauge code (with input from the pilot using
the normal flightcontrols like rudder, ailerons, throttle and elevator axis).
The effects control gauge adds a lot of controlled, visible effects to the aircraft.

Functionality (for details, see below):
- Smooth and stable VTOL/Hover capabilities, with pilot-controlled ascent/descent
  rate, longitudinal and lateral speed, heading, pitch and bank.
- Works under ALL wind conditions; even with a tailwind, it can fly backwards !
- Does NOT influence the aircraft's normal flight characteristics: the gauge
  is only active when the nozzles are rotated more then 80 degrees.
- Controlled effects, like nozzle/N1-dependant smoke, wing /wingtip vortex, a cannon,
  high-altitude contrail.


**** IMPORTANT ****
- This solution also requires prior installation of FSUIPC:
  FSUIPC.dll (v3.4.4 or newer, registered or unregistered).
  If not yet installed, you can download the lastest version of FSUIPC at:
      http://www.schiratti.com/dowson.html
- In menu "Aircraft-Realism Settings", select "Ignore crashes and damage", 
  and uncheck the box "Autorudder". 
- In menu "Views-View Options, select SpotPlane and uncheck the box "Gradual Transition". 
  See also section "limitations" for an explanation.


Detailed functionalty of the "VSTOLControlIPC.xml" gauge
========================================================
This gauge consists of two parts:
- A functional part (_Func)
  This gauge should only be defined ONCE.
- A display/click part (_Display)
  This gauge can be defined multiple times, e.g. in 2D Cockpit and in VC.

The _Display gauge has a clickable bitmap with tooltips.
It displays:
- The FS2004 "flaps" position:
  - White Needle: the Flaps position (flaps-position 0-3, 0-40 degrees)
  - Green Needle: the Nozzles position (flaps-position 4-9, 0-98 degrees)
- Other info:
  - Short Red Needle: the winddirection, relative to the aircraft.
  - Top-Left number: Radio Altitude, in feet.
  - Top-Center number: Windspeed, in knots.
  - Top-Right number: Pitch, in degrees.

Beside using the normal keys/buttons to in/decrease "flaps", you can also
click the gauge. See ToolTips.
- TopLeft:     Display/Hide RadioAltitude info.
- TopRight:    Display/Hide Pitch info.
- TopCenter:   Display/Hide Wind info.
- BottomLeft:  Increment flaps/nozzles.
- BottomRight: Decrement flaps/nozzles.

The _Function gauge:
The VTOL function becomes active when the nozzles are rotated to a position greater
than 80 degrees. When active:
- RUDDER axis changes heading.
- AILERON axis changes bank (+/- 10 deg), and therefore lateral-speed. 
- ELEVATOR axis changes Pitch (15 deg down to 23 deg up, 4 deg. up when centered) 
- FLAPS controls nozzles (50, 82, 86, 90, 94 and 98 deg.)
  50 deg. is used for STOL, 82-98 for VTOL/Hover.
- THROTTLE axis changes thrust, and therefore longitudinal speed and altitude; 
  both proportionally to Weight, N1, and the "thrust-attitude".

About "thrust-attitude": the Harrier normally hovers with nozzles at 90 deg. 
and 6 deg. pitch up; in this attitude the thrust is directed straight downward,
and therefore airspeed is exactly 0 knots (the groundspeed depends on the wind).
Now, "thrust-attitude" is the resultant of actual pitch and nozzle angle; so if
you e.g. set nozzles to the 98 deg (called FullBrakingStop position) and pitch
to 4 deg. downward, it will again hover with exactly 0 airspeed because thrust
is still directed straight down.
Likewise:
- Pitching down from the standard 4 degr. up, OR decreasing nozzle angle from
  the standard 90 deg, will move the aircraft forward.
- Pitching up from the standard 4 degr. up, OR increasing nozzle angle from the 
  standard 90 deg, will move the aircraft backward.
Hence, you can hover with ANY airspeed between 50 knots forward and backward, 
depending on current nozzle direction and pitch !!
Also note, that if thrust is not directed exactly downward (so airspeed is unequal
to 0) you obviously need more thrust (higher N1) to maintain the same altitude.
Again, this effect is proportional; to the extent that even at full thrust you
cannot maintain altitude anymore (if the aircraft is heavy enough).

Lastly: when the engine is OFF, the flaps/nozzles are forced to 0.

Detailed functionalty of the "HarrierEffectControl.xml" gauge
=============================================================
This gauge controls several addon effects, by controlling light switches
defined in the aircraft.cfg:
- Engine smoke effects, coupled to:
  - WING LIGHT (#8), for smoke directed downward.
    ON: When N1 greater then 70% and nozzles at 82 - 98 deg.
  - LOGO LIGHT (#9), for smoke directed backwards.
    ON: When N1 greater then 70% and nozzles at 0 deg.
  - CABIN LIGHT (#10), for smoke directed at 45 deg angle.
    ON: When N1 greater then 70% and nozzles at 50 deg.
- Wingtip vortex and Wing vapor effect, coupled to TAXI LIGHT (#6).
  ON: When airspeed is greater than 100 Knots IAS, AND Gforce greater than 3.
- Cannon fire effect, coupled to RECOGNITION LIGHT (#7).
  ON: When "triggered" by the user: either via a key or joystick button that
      generates AfterburnerToggle events (default key: Shift-F4).



IMPORTANT NOTES AND LIMITATIONS
===============================
1. As outlined above (because this is an addon) I have to work within what's
   possible for an existing model; like: visible nozzle animations are usually
   coupled in the model to Flaps, and not an contiguous axis of its own (although
   of course that would require a seperate "nozzle" hardware controller axis as 
   well); Hence the limitation of discrete nozzle settings, since FS2004 only
   provides for max. 10 flap positions.
2. At touchdown after a zero-speed hover (when the VTOL gauge deactivates), the
   aircraft may become overstressed. This is a side-effect of the used solution.
   Hence the reason to deactivate the CrashDetection in FS2004.
3. Since altitude changes are gauge-calculated (and therefore discrete steps),
   when hovering in SpotPlane view the scenery may be a bit "jerky" (jumping up
   and down), especially when "Gradial Transition" is ON. Because FS is constantly
   trying to smooth out the discrete altitude in-(de-)crements.
   Hence the reason to switch it OFF.
4. Make sure that your external control devices (joystick/pedals) are well-calibrated.
5. When VTOL-control is Active:
   - FS2004 gets a bit confused with its Stall warnings.
     Hence, in the aircraft.cfg, I inhibited Stall warning by setting extreme Stall
     speed warning limits.
   - The IAS reading of your normal speed meter is not accurate.
     It displays the IAS calculated by FS, NOT the real IAS set by my gauge.
   - Although the Elevator, Rudder and Ailerons function are now controlling other
     functions (the ReactionControlSystem), the aircraft rudder, nosewheel, elevator
     and ailerons visual animations still work. Just ignore them :-)
   - DO NOT use SLEW or PAUSE, or save a flight when VTOL-control is active.
     That is: since the gauge remains active, the result is unpredictable after
     resuming normal operation or reloading the flight.
   - The visual cannon effect behaves funny: it fires the bullets downward instead
     of forward :-)  Sorry, no solution for that.


(V)(S)TOL operation tips
========================
1. Vertical Takeoff
- Make sure you are not too heavy; reduce fuel if necessary.
  Note that the max. VTOL weight for a Harrier is about 21000 lbs, given the max. thrust
  of 21500 lbs.
  IF TOO HEAVY, THE AIRCRAFT WON'T LIFT OFF !
- Taxi your aircraft to the Takeoff position.
- Set nozzles to 90 deg., using default keys F6/F7 or mouseclicking the flaps/nozzles
  position bitmap.
  NOTE: F8 sets FullFlaps (== nozzles 98 deg, NOT 90 deg.)
- Apply full throttle,
  When N1 becomes > 90% (Weight-dependant), the aircraft will lift off.
- Raise the gear.
- When you reach sufficient height, gradually move the nozzles and flaps to normal
  position, using "flaps-decrement" (default key: F6, or by clicking the gauge).
  When transitioning from 80 to 50 deg nozzles, apply a little backpressure on the
  stick (elevator), to avoid the nose dropping when the VTOL gauge releases control.
- And if your are lazy :-) : set "flaps-up" immediately (default key: F4).
  The aircraft now will accelerate quickly to 250 knots, after which VTOL-control
  deactivates and you can fly the aircraft as usual.
  
2. Short Takeoff.
- Taxi your aircraft to the Takeoff position.
- Set flaps to Flaps 40, Nozzles 0 degrees.
- Apply full throttle.
- At around 60 knots, increment flaps (F7) to set nozzles at 50 deg.
- The aircraft will lift off now.
- Raise the gear.
- Gradually move nozzles and flaps to the normal flight position.

3. Vertical Landing.
- Make sure you are not too heavy (see "Vertical Takeoff").
- Descent, slow down and gradually lower Flaps.
- Around 170 knots and 1/2 a mile before landing spot, rotate nozzles to 90
  deg and throttle up.
  The airspeed will gradually reduce to 0.
- And if your are lazy :-) : set nozzles to FullBrakingStop immdiately (default
  key: F8), from ANY speed. The aircraft now will decellerate quickly.
  Note that the speed of decelleration depends on the actual nozzle position. !
- Lower the gear.
- Hover the aircraft to the landing spot, using throttle, stick and rudder.
  When near the landing spot, preferably turn the aircraft straight into to
  the wind and descent slowly (with zero groundspeed) untill touchdown.
- Set brakes, throttle to idle, and flaps/nozzles to 0.
- Release brakes and taxi to the parking spot.

4. Short Landing.
- Descent, slow down and gradually lower Flaps to 40 deg.
  Make sure you are lined up with the runway.
- Around 120 knots and 1/2 a mile before landing spot, rotate nozzles to 50.
- Lower the gear.
- After touchdown, apply brakes, set flaps/nozzles to 0 and taxi.

5. Hover.
During a hover (nozzles 82-98 degrees), you can change direction, longitudinal/lateral
speed and altitude using your controls. See section "Detailed functionality"
So longitudinal and lateral groundspeed is also dependant on windspeed/direction.
To hover with zero groundspeed, compensate the wind with Elevator (Pitch), Flaps (Nozzle
position 82 - 98 deg) and Ailerons.

When N1 thrust > "x"%, altitude will increase, when < "x"% altitude will decrease
(proportional to N1). "x" is the "CenterThrust" in the gauge, which is the
N1 value at which the hover altitude remains constant, but corrected for:
- The actual aircraft Weight.
  - "CenterThrust" for min weight (no fuel) is 75 %
  - "CenterThrust" for max VTOL weight (21000 pounds) is 96%
  - And liniairly between 75 and 96% for all weights 15000 and 21000 lbs.
- The "Thrust Attitude", as explained above.

6. Groundroll.
On the ground and nozzles less then 80 deg., VTOL is not active and the groundroll 
is as usual. However when nozzles are set greater then 80 deg (and Brakes Off), the
roll speed depends on the set nozzle position and throttle.
So the aircraft will roll forward (nozzles 94,98) or even backwards (82,86), with
a groundspeed depending on throttle.
And at nozzles 90, the aircraft won't move at all !! (since thrust is directed
straight down). 
Of course, keep thrust below "CenterThrust" or your aircraft will takeoff :-)
 

7. Performing the Harrier "bow".
Now, here's a spectacular effect; just like in real life (although with different
controls) !
- Make sure you are in a stable hover: nozzles at 90, pitch at 4 deg. up and
  throttle at a position where altitude is more or less constant.
- Make sure you have enough altitude: at least 100 feet AGL
- Go into Spotplane View.
- Rotate the nozzles to FBS (98 deg), by pressing F8.
  The aircraft will slowly build up backward airspeed.
- After a sec. or 2 (backwards speed is about 20 knots), press the elevator fully
  forward. The nose will quickly drop and the backward momentum is stopped.
- When the airspeed hits about 0 knots, center the elevator.
  The aircraft pitches up again to 4 deg. up.
- Set nozzles back to 90 deg. again (press F6 twice).
   

How a real Harrier operates
===========================
Note that this info may not be 100% correct, and certainly not complete :-)

In a hover (nozzles rotated to 90 degrees) all thrust is directed downwards;
hence the aircraft weight must be less then the max. thrust to maintain (or even
increase) altitude; i.o.w. thrust (throttle) determines whether you are as/decending
or maintain current altitude.

The pilot can control the attitude of the aircraft via a Reaction Control System (RCS):
a set of "puffers" on the nose, tail and wings of the aircraft that uses compressed,
bleed air from the main engine.
1. Lateral movement (Roll).
   Moving the stick to the left opens the valve on the left wing, which pushes that
   wing down. Since the the thrust now is no longer directed underneath the aircraft,
   it is pushed sideways (to the left). 
2. Directional movement. (Yaw).
   Likewise there is a puffer jet on the tail boom which controls left or right yaw
   in the same way as lateral movement.
3. Forward/backward movement.
   This is controlled by changing the downward thrust direction, either by: 
   - Rotating the four main nozzles (from 90 degrees position) slightly forward or
     backward.
   - Pitching the nose up or down (like a helicopter) via puffers in the nose and
     tailboom. 
   Usually the nozzles are adjusted to keep the aircraft more stable.


Credits, Copyrights and Disclaimer
=================================
This package is freeware, and is available for your personal use.
Without my explicite permission, it may NOT be sold, modified, re-distributed, 
re-bundled and/or uploaded to another website or bulletin board in ANY shape or form.
And obviously, installing & using this package is at your own risk. 

Thanks to:
- Doug Dawson, for his great "XML2IPC" gauge, which allows me to interface from my
  XML code to FSUIPC.
- Peter Dowson, for creating/maintaining FSUIPC.


Enjoy ......

Rob Barendregt, The Netherlands
Email: rc.barendregt@planet.nl



*******************************  End of README  *******************************
 